﻿using AiXiu.BLL;
using AiXiu.Common;
using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AiXiu.WebSite
{
    public partial class Phone : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                //获取用户输入的用户名和密码
                string phone = txtMobileNumber.Text;
                string pwd = txtPassword.Text;
                //调用BLL层的登录方法
                LoginBLL loginBLL = new LoginBLL();
                OperResult<TBUsers> operResult = loginBLL.Phonein(phone, pwd);
                if (operResult.StatusCode == StatusCode.Succeed)
                {
                    //登录成功
                    Response.Redirect("UserList.aspx");
                }
                else
                {
                    this.Alert("lgnfail", operResult.Message ?? "登录失败！");
                }
            }
        }
    }
}